package com.daiqee.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.daiqee.pojo.SupplierArrears;
import com.daiqee.dao.mapper.SupplierArrearsMapper;

/**
 * 供应商欠款
 * 
 * <br/>
 * @since JDK 1.8
 * @version  V2.1
 * @author RichardTang 
 * @date: 2018年5月8日 上午8:27:52
 * @package com.daiqee.service.impl
 * @copyright:Copyright (c) 2018, 1245811923@qq.com All Rights Reserved.
 */
@Service
public class SupplierArrearsService extends ServiceImpl<SupplierArrearsMapper, SupplierArrears>{
	
	@Autowired
	private SupplierArrearsMapper supplierArrearsMapper;

	/**
	 * 查询数据库欠款中是否存在该供应商
	 * @Time 2018年3月8日15:29:45
	 * @since 2.1
	 * @version 2.1
	 * @author RicahrdTang
	 * @return true:不存在该供应商，false:存在该供应商
	 */
	public Boolean querySupplierIsExist(String supplierName) {
		List<SupplierArrears> selectByExample = supplierArrearsMapper.selectList(
				new EntityWrapper<SupplierArrears>().eq("sup_arre_supplier_name",supplierName)
		);
		if(selectByExample==null||selectByExample.size()<=0||selectByExample.isEmpty()) {
			return true;
		}else {
			return false;
		}
	}

}
